<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Audittrail extends CI_Controller
{
	function __construct()
	{
		parent::__construct();		
		if (!$this->tank_auth->is_logged_in()) redirect('auth/login');				
		
		//load models
		$this->load->model('Default_db');
		$this->load->model('Audittrail_db');
	}
	
	/*VIEW FUNCTIONS*/
	function index()
	{	
		redirect('audittrail/manage');
	}
	
	function manage()
	{
		//default
		$data['ptitle'] = "Manage Audittrail";				
		$data['username'] = $this->tank_auth->get_username();
		$data['module'] = 'audittrail';
		$data['active_header'] = 'admin';
		//end default		
		
		$data['content'] = $this->load->view('manage',$data,true);		
		$this->load->view('default_view',$data);
	}
	
	/*END VIEW FUNCTIONS*/
	
	
	/* AJAX FUNCTIONS */
	function listview()
	{
		$data = $this->Audittrail_db->getList();
		echo json_encode($data);
	}
	/* END AJAX FUNCTIONS */
	
	
	/* LOAD MODULE JS */
	function js() {
        $this->load->view('js/script.js');
    }
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */